@extends('layouts.app')

@section('content')

    <div class="container">

    <form action="{{url('resource/'.$url)}}" method="post">
        {!! csrf_field() !!}
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                @if(isset($action))
                    {{--导航--}}
                    <ul class="nav nav-tabs nav-justified">
                        <li role="presentation" @if($action == 'show') class="active" @endif><a href="{{url('resource/ms_assign/show')}}">待分配</a></li>
                        <li role="presentation" @if($action == 'done') class="active" @endif><a href="{{url('resource/ms_assign/done')}}">已分配资源</a></li>
                        <li role="presentation" @if($action == 'again') class="active" @endif><a href="{{url('resource/ms_assign/again')}}">再约资源</a></li>
                        <li role="presentation" @if($action == 'false') class="active" @endif><a href="{{url('resource/ms_assign/false')}}">未成交</a></li>
                        <li role="presentation" @if($action == 'outtime') class="active" @endif><a href="{{url('resource/ms_assign/outtime')}}">过期资源</a></li>
                        <li role="presentation" @if($action == 'void') class="active" @endif><a href="{{url('resource/ms_assign/void')}}">无效订单审核</a></li>

                    </ul>
                @endif
                <div class="panel panel-default">
                    <div class="panel-heading">{{$type}}</div>
                    @if (count($errors) > 0)
                        <div class="alert alert-danger">
                            <ul>
                                @foreach ($errors->all() as $error)
                                    <li>{{ $error }}</li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                    @if(session('message')!=null)
                        <div class="alert alert-success">
                            <ul>
                                <li>{{ session('message') }}</li>
                            </ul>
                        </div>
                    @endif
                    <table class="table table-hover">
                        <tr>
                            @if(is_object($users))
                            <td class="success">选择</td>
                            @endif
                            <td class="success">资源id</td>
                            <td class="success">姓名</td>
                            <td class="success">基本信息</td>
                            <td class="success">录入人</td>
                            <td class="success">进程</td>
                            <td class="success">创建时间</td>
                            <td class="success">
                                操作
                            </td>
                        </tr>
                        @foreach($datas as $data)
                            <tr>
                                @if(is_object($users))
                                <td class="active">
                                    <input type="checkbox" name="assign_id[]" id="" value="{{$data->id}}">
                                </td>
                                @endif
                                <td class="active">{{$data->id}}</td>
                                <td class="active">{{$data->name}}</td>
                                <td class="active">
                                    <select name="" id="" class="form-control">
                                        <option value="">手机:{{$data->phone}}</option>
                                        <option value="">备机:{{$data->phone2}}</option>
                                        <option value="">QQ:{{$data->qq}}</option>
                                        <option value="">微信:{{$data->wechat}}</option>
                                        <option value="">预算:{{$data->budget}}</option>
                                        <option value="">邀约进程:{{$data->yy_process_id}}</option>
                                        <option value="">邀约员工:{{$data->yyyg_id}}</option>
                                        <option value="">操作时间:{{date('y-m-d',$data->yyyg_time)}}</option>
                                        <option value="">邀约结果:{{$data->invite_status}}</option>
                                        <option value="">资源类型:{{$data->res_type_tid}}</option>
                                        <option value="">资源来源:{{$data->res_resource_rid}}</option>
                                        <option value="">再约时间:{{date('y-m-d',$data->yy_time_again)}}</option>
                                        <option value="">预算:{{$data->budget}}</option>
                                    </select>
                                </td>
                                <td class="active">{{$data->users_id}}</td>
                                <td class="active">{{$data->process_id}}</td>
                                <td class="active">{{$data->created_at}}</td>
                                <td class="active">
                                    <a href="{{url('resource/remark')}}/{{$data->id}}">显示详情</a>
                                    <a href="{{url('resource/edit')}}/{{$data->id}}">编辑</a>
                                    <a href="{{url('resource/destroy')}}/{{$data->id}}">删除</a>
                                </td>
                            </tr>
                        @endforeach
                    </table>
                </div>
            </div>
        </div>
    @if(is_object($users))
        <div class="row">
            <div class="col-md-10 col-md-offset-1">
                <div class="panel panel-default">
                    <div class="panel-heading">可分配员工</div>
                    <table class="table table-hover">
                        <tr>
                            <td class="success">选择</td>
                            <td class="success">员工id</td>
                            <td class="success">员工名</td>
                        </tr>
                        @foreach($users as $user)
                            <tr>
                                <td><input type="radio" name="yyyg_id" id="" value="{{$user->id}}"></td>
                                <td>{{$user->id}}</td>
                                <td>{{$user->name}}</td>
                            </tr>
                        @endforeach
                    </table>

                </div>
                <input type="submit" class="btn btn-primary" value="提交">
            </div>
        </div>
    @endif
    </form>
    </div>
@endsection